<?php

namespace frontend\modules\member\controllers;

use Yii;
use frontend\components\Controller;
use common\models\member\MemberPrivilege;

/**
 * 会员权益
 *
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class PrivilegeController extends Controller {

    /**
     * @inheritdoc
     */
    public function actionIndex($id) {
        return MemberPrivilege::find()->active()->andWhere([
            'type_id' => [
                0, $id
            ],
        ])->orderBy([
            'type_id' => SORT_ASC,
            'listorder' => SORT_ASC
        ])->all();
    }

}
